package com.example.common.util;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@ConditionalOnProperty(name = "adminIds")
public class AdminUtil {
    @Value("${adminIds}")
    List<Long> adminIds;

    public boolean isAdmin(Long userId) {
        return adminIds.contains(userId);
    }
}
